
from django.db import models
# 搭建创建时间修改时间拓展模型类
class DateTimeModelsMixin(models.Model):
    create_time = models.DateTimeField(auto_now_add=True,verbose_name="创建时间")
    update_time = models.DateTimeField(auto_now=True,verbose_name="修改时间")

    class Meta:
        abstract = True

# 搭建逻辑删除拓展模型类
class IsDeleteModelsMixin(models.Model):
    is_delete = models.BooleanField(default=False,verbose_name="逻辑删除")
    class Meta:
        abstract = True

class ModelsSetMixin(DateTimeModelsMixin, IsDeleteModelsMixin):
    class Meta:
        abstract = True  # 指定该类为抽象模型类 不会再迁移映射时生成模型表
